﻿using Pysics2D;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Pysical2DTest_Form
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        Masspoint mass;
        Graphics g;
        
        private void button1_Click(object sender, EventArgs e)
        {

            Pysics2D.Environment.Meter = 50;
            Pysics2D.Environment.Second = 1;
            mass = new Masspoint(10);
            Speed speed = new Speed(0,0);
            Force force = new Force(100,2);
            mass.Speed = speed;
            mass.AddForce(force);
            g = this.CreateGraphics();
            timer1.Enabled = true;
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            Rectangle rect = new Rectangle(new Point(0, 0), new Size(20, 20));
            g.Clear(Color.White);
            mass.Next();
            rect.Location = new Point(mass.Location.X, mass.Location.Y);
            g.FillEllipse(Brushes.Black, rect);
        }
    }
}
